//#include "DllExports.h"
//#include "HairSimulator.h"
#include "DllExports.h"
#include "HairCore.h"


namespace XRwy {

	using namespace std;

	HairSimulator *simulator = nullptr;

	int InitializeHairEngine(const HairParameter* param, const CollisionParameter* col, const SkinningParameter* skin, const PbdParameter* pbd
	) {
		return 0;
	}

	int UpdateParameter(const char* key, const char* value) {
		return 0;
	}

	int UpdateHairEngine(
		const float head_matrix[16],
		const float collision_world2local_matrix[16],
		float *particle_positions,
		float *particle_directions,
		float delta_time
	) {
		return 0;
	}

	void ReleaseHairEngine() {

	}

	int GetHairParticleCount() {
		return 0;
	}

	int GetParticlePerStrandCount() {
		return -1;
	}
	
	int InitCollisionObject(int nvertices, int nfaces, const float *vertices, const int *faces) {
		return 0;
	}
	

	/*
	void GenerateGrid2Object() {
		size_t buck_size = 100000;

		Poly3 poly;

		unordered_map<Point3, int, UnorderedMapHashPoint3, UnorderedMapEqualToPoint3> remap_v;
		vector<FaceIndex> remap_fv;
		vector<Point3> remap_vv;

		int nvertices, nfaces;
		float *vertices;
		int *faces;
		ifstream fin("C:\\Users\\vivid\\Desktop\\MeshInfo.txt", ios::in);

		fin >> nvertices;
		vertices = new float[3 * nvertices];
		for (int i = 0; i < 3 * nvertices; ++i) {
			fin >> vertices[i];
		}
		fin >> nfaces;
		faces = new int[3 * nfaces];
		for (int i = 0; i < 3 * nfaces; ++i)
			fin >> faces[i];

		fin.close();


		for (int i = 0, count = 0; i < nvertices * 3; i += 3) {
			auto v = Point3(vertices[i], vertices[i + 1], vertices[i + 2]);
			if (remap_v.find(v) == remap_v.end()) {
				remap_v.insert(pair<Point3, int>(v, count++));
				remap_vv.push_back(v);
			}
		}

		cout << "Total: " << nvertices << " to " << remap_vv.size() << endl;

		for (int i = 0; i < nfaces * 3; i += 3) {
			auto find_new_idx = [&remap_v, &vertices](const int idx) -> int {
				auto v = Point3(vertices[idx * 3], vertices[idx * 3 + 1], vertices[idx * 3 + 2]);
				return remap_v.find(v)->second;
			};

			remap_fv.push_back(FaceIndex{ find_new_idx(faces[i]), find_new_idx(faces[i + 1]), find_new_idx(faces[i + 2]) });
		}

		ofstream fout("C:\\Users\\vivid\\Desktop\\MeshInfoModified.txt", ios::out);
		fout << remap_vv.size() << endl;

		for (const auto & point : remap_vv)
			fout << point[0] << " " << point[1] << " " << point[2] << endl;

		fout << remap_fv.size() << endl;
		for (const auto & face_idx : remap_fv) {
			fout << face_idx.a << " " << face_idx.b << " " << face_idx.c << endl;
		}

		fout.close();

		PolyhedronBuilder<Poly3::HalfedgeDS> builder(remap_vv, remap_fv);
		poly.delegate(builder);

		ICollisionObject *collision_object;
		collision_object = WR::CreateGridCollisionObject2(poly, 128);

		WriteGridCollisionObject(collision_object, "C:\\Codes\\Projects\\SJTU Final Project\\dxsimhairdata\\grid\\collisionobject.grid2");
	}
	*/

	int GetStrandColor(int *color_buffer) {
		return 0;
	}

	void GetParticlePositions(float *particle_positions) {

	}

	void DebugCode() {
	}
}